<?php
	include_once 'isLogin.php';

	if($_GET['action']=="pwd"){
		$sql="update admin set pwd='".md5("123456")."' where id=".$_POST['id'];
		echo $commonc->query($sql);
		exit();
	}
	if($_GET['action']=="del"){
		echo $commonc->del("admin", $_POST['id']);
		exit();
	}

	$key = "a.*,g.group_name";
	$sql = "admin a
			left join admin_groups g on g.id=a.group_id where a.group_id=1
			order by a.group_id";
	$admin = $commonc->getList($sql,$sql,$key);
	$smarty->assign("admin",$admin['result']);
	$smarty->assign('pages',$admin['page']);

	$smarty->display("admin_list.html");
?>